﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class db : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

        string file = Server.MapPath("~/App_Data/Database.mdf");
        string connStr = @"Data Source=.\SQLEXPRESS; AttachDbFilename=" + file + @"; Integrated Security=True; Connect Timeout=30; User Instance=True";

        SqlDataSource1.ConnectionString = connStr;
        SqlDataSource1.SelectCommand = " select * from Table1";

    }
}